perm filename XGPSYN.HPM[UP,DOC]1 blob sn#508870 filedate 1980-05-09 generic text, type T, neo UTF8
XGPSYN

	XGPSYN displays files on the video synthesizer, imitating the XGP.
It can fill the screen with 1/2, 1 or 2 pages at time. XGPSYN can also
list documents on the XGP, with no complexity limit, and make hand/eye
compatible picture files which can be sent to printers like the VARIAN, or
displayed on screens. XGPSYG has the added capability of inserting
drawings and pictures into the assembled pages.


	To run the programs, tell them which file you want to look at,
either in the command line (R XGPSYN;FILENAME) or in answer to the FILE:
question, and any spooler style switches, such as /FONT=BASL30 (.XGP files
already contain most necessary switches).  The page number questions can be
answered with the page you want to view, any additional spooler switches,
or one of the following commands:

H        Half density. Next display will be 1/2 page/screen.
F        Full density. 1 page/screen.
D        Double density. 2 pages/screen.

C        display on your own DD channel instead of video synthesizer
S        use video synthesizer instead of own channel

V        view. Redraw the last display.
W        negate subsequent displays. B/W → W/B and W/B → B/W.
K        kill. Erase the synthesizer.
Q        quit. Exit program and load line editor with XS command.

L(a:b)   list pages a thru b on the XGP. Slower, more tolerant than XSPOOL.

B        Bitwise resolution. Next display will be suitable for XGPing.
T        Transposed bitwise resolution. Sideways B.
E        Enormous resolution. Next display can be sent expanded to XGP.

O        output the last display as a data compressed picture file.
P        output the last display as a standard hand/eye picture file.
X        XGP output the last B,T or E display.

	The video synthesizer is a video rate D/A driven by data disc
channels 30 through 37. H density requires 3 of these channels, F needs 4
and D wants 5. These are rarely available during heavy system load. It
takes about 6 CPU seconds to compose a single page.

XGPSYG

	XGPSYG is an extended version of XGPSYN which permits inclusion in
displayed or listed documents of "GOD" graphics files produced with the
GRAHDR.SAI[GOD,HPM] package, or Leland Smith format music files, or gray
scale pictures stored in hand/eye format files

GOD Files and XGPSYG

	The following program writes the GOD file that produced Figure
10-1 in Chapter 10 of Hans Moravec's thesis. Some clue as to its operation
may be obtained by reading GUIDE.GRA[GRA,HPM].

BEGIN "PRETTY"
REQUIRE "TYPHDR.SAI[GOD,HPM]" SOURCE_FILE;

INTEGER FJ,I,J,K,L,M,N; REAL P,Q;
REAL ARRAY X,Y[1:10];

FJ←FILJOB("DSK:PRETTY.GOD[DIA,HPM]"); comment Create the GOD file;

DDINIT; SCREEN(-1.2,-1.2,1.2,1.2);  comment initialize display buffer;

PICFIL(-1,-1,1,1,"U:SF2.PIC[DIA,HPM]"); LITEN; comment insert a gray scale picture;
LINE(-1,-1,-1,1); LINE(1,1,-1,1);      comment draw a border around it;
LINE(1,1,1,-1);   LINE(-1,-1,1,-1);

FNTSELECT(2,"METMBM"); FNTSELECT(3,"METSBM");  comment select some fonts;
FNTSELECT(103,"BASL30");

FNTPOS(-1,1.03,1,1,0,0);		       comment write in font 2;
FNTEXT(0,0,2,"See the pretty aeroplane");

DRKEN;
   BEGIN REAL ARRAY X,Y[1:20]; INTEGER I;      comment draw a balloon;
   FOR I←1 STEP 1 UNTIL 20 DO
     BEGIN X[I]←.89+0.304*COS((I-1)*2*3.14159/20);
     Y[I]←.5+0.12*SIN((I-1)*2*3.14159/20); END;
   X[12]←.62; Y[12]←-.23;
   POLYGO(20,X[1],Y[1]);
   LITEN;
   FOR I←1 STEP 1 UNTIL 20 DO
      LINE(X[I],Y[I],X[(I MOD 20)+1],Y[(I MOD 20)+1],3);
   END;

FNTPOS(.89,.5);		comment write into the balloon in font 3;
DEPOSIT(0,0,CENTER(JTXT(3,"Yow !!!  I am an L1011 !!")));

DPYUP(-1); KILJOB(FJ);  comment close the GOD file;
END;

	The GOD file contains graphics commands like line, dot, text,
picture etc. When PRETTY.SAI says LINE(...) a line command gets written
into PRETTY.GOD. When it says PICFIL(..., ``SF1.PIC'') a binary rendition
of the command gets written into the file.  It is the job of whatever
program reads PRETTY.GOD to deposit the picture when it encounters the
PICFIL command in it, just like it's its responsibility to draw a line
when it sees a LINE command.

	You can insert a .GOD file into as document with XGPSYG by
including a line of the form

		  ⊂⊗⊃G[0,.5](5,4):PRETTY.GOD[GOD,HPM]⊂⊗⊃

in your document text.

	This  means 

	    Here is an escape! ⊂⊗⊃

	    its a GOD file escape  "G" (alternatives are P for a gray scale
					picture and L for a music score file)

	    put diagram's center diagram 0 inches right and
	    0.5 inches above the page center "[0, .5]"

	    the diagram is to be 5 inches wide by 4 inches high "(5, 4)"

	    get your graphics commands from the file PRETTY.GOD[DIA,HPM]

	    Here is the end of the escape! ⊂⊗⊃

	The position field in square brackets and the size field in parens
are optional. If left out, the picture will be centered around where your
escape text would have appeared if you had XSPOOLED'd or XGPSYN'ed your
document. An alternative form for the position field is [%-2.3,%+3.7],
which means the center of the diagram is to be put 2.3 inches to the left
and 3.7 inches above where your escape sequence would have been deposited.
Thus you can position diagrams on the page either absolutely, or relative
to the position of the escape sequence.  This allows you to, for example,
center your diagram using a text processors text centering features.  It
is ok to make the X position, say, relative and the Y position absolute.
SWITCHES

	XGPSYN and XGPSYG understand the following switches, some of which
are not standard with the spooler or the COPY program. The switch names
may be abbreviated to the capitalized portion.


/FONT="fontname"
	Select font number 0 for the document.

/FONT$\#$n="fontname"
	Select font number n for the document.

/THickness=t
	Select line thickness for Leland's music files.

/ESCape=...
	change the escape sequence. Any characters except slash are ok.

/REpeat=n
	When listing, make n copies of each page.

/TMar=n
	Set the top margin of a listing n raster lines from top of page.

/PMar=n
	Set the text portion of the page to be n lines tall.

/BMar=n
	Make the bottom margin n raster lines big. In listings the sum of
TMAR+PMAR+BMAR is the physical length of the page.

/LMar=n
	Set the left margin n pixels from left edge of paper.

/RMar=n
	Set the right margin n pixels from the left edge of the paper.
When writing picture files of page images, RMAR is the physical width of
the resulting image.

/List
	List the document on the XGP. Possible forms are /L to list the
whole document, /L(n) to list page n and /L(a:b) to list all the pages
between a and b. The simplest way to list a document with XGPSYN is by
incanting R XGPSYN;file/L.

/XLine=n
	Insert n extra scanlines between lines of text. This number is
initially 3.

/INterchar=n
	Insert n extra columns between characters of text.  This number is
usually zero.

/XShift=n
	Shift the contents of a page n pixels to the right on the image.
Useful if you want to tweak the margins in a listing, and also for making
images too large to fit in XGPSYN's core image all at once.  Set RMAR
small, the output the same page repeatedly with different XSHIFTS.
Resulting windows can be combined later into a single file representing a
large page.

/YShift=n
	Shift the page contents n pixels up. For tweaking vertical
margins, and also for making very long pages. Set TMAR+PMAR+BMAR small,
then window through the file by changing YSHIFT. If resulting windows are
to be assembled later the EDGE switch is also recommended.

/EDge
	Normally characters that extend past the top margin of a page are
not displayed. /EDGE selects a slower mode in which such fractional
characters do appear. This is necessary if large pages are to be assembled
from small windows.

/XGp
	This file is in .XGP format, whether or not the file extension
says so.

/NOXgp
	This file is not in .XGP form (is not preceded by a switch page).

/NOQueue
	When listing on the XGP, XGPSYN will create a detached job which
waits if the XGP is not available when a page is to be generated.  NOQUEUE
supresses this feature. Instead, XGPSYN itself waits for the XGP.

/NODpy
	Supresses video synthesizer display. Useful if XGPSYN is being
used soley to generate files containing page images. /L invokes this mode
automatically.

/AUTocr
	Insert carriage returns when lines run beyond right margin.

/NOAutocr
	Suppress insertion of extra carriage returns.

/Halfdensity
	Select half page/screen mode.

/Fulldensity
	Select full page/screen mode.

/Doubledensity
	Select two page/screen mode.

/Enormousresolution
	In this mode a screenful of display is generated without any
compression of the original page raster. Very little of a standard page is
visible, but every pixel can be resolved in that portion.

/Bitwisedensity
	Create a one bit/pixel image of the whole page.  This can be sent
to the XGP (/L uses this density) or written into a hand-eye picture file.
Such files can be listed on other printing devices.

/Transposedbitwisedensity
	Like /B, but the image comes out on its side, rotated 90 degrees.

/Varian
	Useful only with XGPSYG. Causes halftones to be generated in a
high density mode which works well with the Varian printer, but causes
washing out on the XGP.